#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
    char ch;
    int n = 0;
    while (scanf("%c", &ch) != EOF) {
        if (ch >= 'a' && ch <= 'z') {
            ch -= 32;
            printf("%c\n", ch);
        }
        else if (ch >= 'A' && ch <= 'Z') {
            ch += 32;
            printf("%c\n", ch);
        }

    }
    return 0;
}
